<!DOCTYPE html>
<html>
<head>
    <title>weighingMachinEntry page</title>
    <link rel="stylesheet" href="../css/jquery.mobile-1.3.2.min.css" />
	<link rel="stylesheet" href="../css/weighingMachinEntry.css" />
    <script type="text/javascript"  src="../js/jquery-1.10.2.min.js"></script>
    <script type="text/javascript" src="../js/jquery.mobile-1.3.2.min.js"></script>
	<script type="text/javascript" src="../js/weighingMachinEntry.js"></script>
	<script type="text/javascript" src="../js/jquery-barcode.min.js"></script>
	<script type="text/javascript">
	
	var w;
	//----------------------field variables---------------
	var rstNoValueVar="";
	var vehicleNoValueVar="";
	var customerNameVar="";
	var addressVar="";
	var commodityVar="";
	var brokerNamevar="";
	var poNoVar="";
	var noOfBagsVar="";
	var grossWeightVar="";
	var tareWeightVar="";
	var netWeightVar="";
	var systemTimeVar="";
	var systemDateVar="";
	var userIdVar="";
	
	
	//-----------------------unique id variables-----------------
	
	var barcodeNoValueFromDatabase="";
	
	function printPage(){
    w.print();
}
	$(document).ready(function(){
	$("#printPageButtonDiv").hide();
	
	$("#printPageButton").bind('click',function(){
	
	w=window.open();
	var html= $("#printPageContentDiv").clone();
	html= $("#printPageContentDiv").html();
	$(w.document.body).html(html);
	$(w.document.body).append('<link rel="stylesheet" href="../css/weighingMachinEntry.css" type="text/css" />');
	setTimeout('printPage();', 1000);
	});
	
	$("#customerName").bind('blur',function(){
	
			alert('function to get the address');
	
	});
	
	$("#generateBarcodeButton").bind("click",function(){
	
		//send pono customer name broker name to database.................
		//get the barcode value...................
		
		rstNoValueVar = $("#RstNoValue").val();
		vehicleNoValueVar = $("#VehicleNoValue").val();
	    customerNameVar = $("#customerName").val();
		addressVar = $("#customerAddressValue").val();
		commodityVar = $("#commodityValue").val();
		brokerNamevar = $("#brokerName").val();
		poNoVar = $("#PONovalue").val();
		noOfBagsVar = $("#BagsNoValue").val();
		grossWeightVar = $("#grossWeight").val();
		tareWeightVar = $("#tareWeight").val();
		netWeightVar = $("#netWeight").val();
		systemTimeVar = $("#SystemTime").val();
		systemDateVar = $("#SystemDate").val();
		userIdVar = $("#UserID").val();
		
		
		
		//assigning value to new page for print
		
		$("#RstNoValueForPrint").text(rstNoValueVar);
		$("#VehicleNoValueForPrint").text(vehicleNoValueVar);
	    $("#customerNameForPrint").text(customerNameVar);
		$("#customerAddressValueForPrint").text(addressVar);
		$("#commodityValueForPrint").text(commodityVar);
		$("#brokerNameForPrint").text(brokerNamevar);
		$("#PONovalueForPrint").text(poNoVar);
		$("#BagsNoValueForPrint").text(noOfBagsVar);
		$("#grossWeightForPrint").text(grossWeightVar);
		$("#tareWeightForPrint").text(tareWeightVar);
		$("#netWeightForPrint").text(netWeightVar);
		$("#SystemTimeForPrint").text(systemTimeVar);
		$("#SystemDateForPrint").text(systemDateVar);
		$("#UserIDForPrint").text(userIdVar);
		
		$('.tdClassForPrint').attr('style','border-left: 1px solid #000;border-right: 1px solid #000;');
		
		
		if(rstNoValueVar=="" || vehicleNoValueVar=="" || customerNameVar=="" || addressVar=="" ||commodityVar=="" || brokerNamevar=="" || 
		    poNoVar=="" || noOfBagsVar=="" || grossWeightVar=="" || tareWeightVar=="" || netWeightVar=="" || systemTimeVar=="" || 
			systemDateVar=="" || userIdVar==""){
		
				alert("please fill all the fields.....All the fields are mandatory");
				$('#printPageButtonDiv').show();
				
				$("#barcodeGeneratorDiv").barcode("12345678901234", "code39",{barWidth:2, barHeight:60,showHRI:false});
					$("#barcodeGeneratorDivForPrint").barcode("12345678901234", "code39",{barWidth:1.3, barHeight:60,showHRI:false});
				
		}else{
		
				alert('call the function');
			
				
		}
		
		
	});
	
	
	});
	
	</script>
 
</head>
<body>
	<div data-role="page" id="weighingMachinEntryPage">
		<div data-role="header" data-position="fixed" data-theme="b" id="weighingMachinEntryHeader">
		<h1>Weightments Entry Page</h1> 
		</div>
		<div align="center" data-role="content" id="weighingMachinEntryContent">
			<h1>PARVATI SOLVENTS EXTRACTION PVT LTD</h1>
			<h3>GUT NO.76, KHADGAON,TALUKA: BADNAPUR,DISTRICT:JALNA-431203,MAHARASHTRA,INDIA</h3>
			<form id="weighingMachineForm" action="" method="POST">
			<div id="tableContainer" class="tableContainer">
			<fieldset>
			<div id="tableDivRegionInfo1" class="tableDivRegion" data-role="fieldcontain">
				<table data-theme="c" border="1" width="80%">
					<tr>
						<td width="20%" class="tableContentTitle"><b>Rst No.</b></td>
						<td width="30%"><input id="RstNoValue" type="text" value="" placeholder="Rst No." class="textBoxClass"/></td>
						<td width="20%" class="tableContentTitle"><b>Vehicle No.</b></td>
						<td width="30%"><input id="VehicleNoValue" type="text" value="" placeholder="Vehicle No" class="textBoxClass"/></td>
					
					</tr>
					
					<tr>
						<td width="20%" class="tableContentTitle"><b>Customer Name</b></td>
						<td width="30%"><input id="customerName" type="search" value="" placeholder="customer Name" class="textBoxClass"/></td>
						<td width="20%" class="tableContentTitle" rowspan="3"><b>Address</b></td>
						<td width="30%" rowspan="3"><textarea disabled="disabled" id="customerAddressValue" rows="4" class="textBoxClass"></textarea></td>
					
					</tr>
					<tr>
						<td width="20%" class="tableContentTitle"><b>Commodity</b></td>
						<td width="30%"><input id="commodityValue" type="text" value="" placeholder="Commodity" class="textBoxClass"/></td>
						
					</tr>
					<tr>
						<td width="20%" class="tableContentTitle"><b>Broker Name</b></td>
						<td width="30%"><input id="brokerName" type="search" value="" placeholder="Broker Name" class="textBoxClass"/></td>
						
					</tr>
					<tr>
						<td width="20%" class="tableContentTitle"><b>P. O. No.</b></td>
						<td width="30%"><input id="PONovalue" type="text" value="" placeholder="P. O. No." class="textBoxClass"/></td>
						<td width="20%" class="tableContentTitle"><b>No. Of Bags</b></td>
						<td width="30%"><input id="BagsNoValue" type="number" value="" min="0" placeholder="No. of bags" class="textBoxClass"/></td>
					
					</tr>
				</table>
				
			</div>
			
			<div id="tableDivRegionInfo2" class="tableDivRegion" data-role="fieldcontain">
			
				<table data-theme="c" border="1" width="80%">
				
					<tr>
						<td width="10%" class="tableContentTitle"><b>Gross Weight  :</b></td>
						<td width="13%"><input id="grossWeight" type="text" value="" placeholder="Gross Weight" class="textBoxClass"/></td>
						<td width="34%" class="tableContentTitle"><b>Barcode</b></td>
						<td width="10%"class="tableContentTitle"><b>System Date :</b></td>
						<td width="13%"><input id="SystemDate" value="dddd" type="text" disabled="disabled" placeholder="dd/mm/yyyy" class="textBoxClass"/></td>
					</tr>
					<tr>
						<td width="10%" class="tableContentTitle"><b>Tare Weight  :</b></td>
						<td width="13%"><input id="tareWeight" type="text" value="" placeholder="Tare Weight" class="textBoxClass"/></td>
						<td width="34%" rowspan="3"><div id="barcodeGeneratorDiv" class="barcodeGeneratorDiv"></div></td>
						<td width="10%" class="tableContentTitle" rowspan="2"><b>System time :</b></td>
						<td width="13%" rowspan="2"><input value="dddd" id="SystemTime" type="text" disabled="disabled" placeholder="hh:mm" class="textBoxClass"/></td>
					</tr>
					<tr>
						<td width="10%" class="tableContentTitle"><b>Net Weight  :</b></td>
						<td width="13%"><input id="netWeight" type="text" value="" placeholder="Net Weight" class="textBoxClass"/></td>
					</tr>
					<tr>
						<td width="10%" class="tableContentTitle"><b>Operator Signature :</b></td>
						<td width="13%"><input id="OperatorSign" type="text" class="textBoxClass"/></td>
						<td width="10%" class="tableContentTitle"><b>User ID :</b></td>
						<td width="13%"><input id="UserID" type="text" class="textBoxClass"/></td>
					</tr>
				
				</table>
			</div>
			</fieldset>
			</div>
			</form>
			<div id="submitPageDiv" class="submitPageDiv">
				<button data-theme="a" type="submit" id="generateBarcodeButton">Generate Barcode </button>
				<div id="printPageButtonDiv"><button type="button" data-theme="a"  id="printPageButton">Print</button></div>
				
			</div>
		</div>
		
		
	</div>
	
	<div id="printPageContentDiv">
	
	<div id="tableContainerForPrint">
			<fieldset>
			<div id="headerForPrint" style="margin-right: auto; margin-left: auto;">
			<center><h2 style="margin-bottom: -3%;margin-top: -0.5%;">PARVATI SOLVENTS EXTRACTION PVT LTD</h2>
			<h6>GUT NO.76, KHADGAON,TALUKA: BADNAPUR,DISTRICT:JALNA-431203,MAHARASHTRA,INDIA</h6></center>
			<div>
			<div id="tableDivRegionInfo1forPrint" data-role="fieldcontain">
				<table data-theme="c" border="1" width="80%" style="border:none;border-collapse: collapse; margin-left: auto;margin-right: auto;">
					<tr>
						<td width="20%" class="tableContentTitle tdClassForPrint"><b>Rst No.</b></td>
						<td width="30%" class="tdClassForPrint"><div id="RstNoValueForPrint"></div></td>
						<td width="20%" class="tableContentTitle tdClassForPrint"><b>Vehicle No.</b></td>
						<td width="30%" class="tdClassForPrint"><div id="VehicleNoValueForPrint"></div></td>
					
					</tr>
					
					<tr>
						<td width="20%" class="tableContentTitle tdClassForPrint"><b>Customer Name</b></td>
						<td width="30%" class="tdClassForPrint"><div id="customerNameForPrint"></div></td>
						<td width="20%" class="tableContentTitle tdClassForPrint" rowspan="3"><b>Address</b></td>
						<td width="30%" rowspan="3" class="tdClassForPrint"><div id="customerAddressValueForPrint"></div></td>
					  
					</tr>
					<tr>
						<td width="20%" class="tableContentTitle tdClassForPrint"><b>Commodity</b></td>
						<td width="30%" class="tdClassForPrint"><div id="commodityValueForPrint"></div></td>
						
					</tr>
					<tr>
						<td width="20%" class="tableContentTitle tdClassForPrint"><b>Broker Name</b></td>
						<td width="30%" class="tdClassForPrint"><div id="brokerNameForPrint"></div></td>
						
					</tr>
					<tr>
						<td width="20%" class="tableContentTitle tdClassForPrint"><b>P. O. No.</b></td>
						<td width="30%" class="tdClassForPrint"><div id="PONovalueForPrint"></div></td>
						<td width="20%" class="tableContentTitle tdClassForPrint"><b>No. Of Bags</b></td>
						<td width="30%" class="tdClassForPrint"><div id="BagsNoValueForPrint"></div></td>
					 
					</tr>
				</table>
				
			</div>
			<br/>
			
			<div id="tableDivRegionInfo2" class="tableDivRegion" data-role="fieldcontain">
			
				<table data-theme="c" border="1" width="80%" style="border:none;border-collapse: collapse; margin-left: auto;margin-right: auto;">
				
					<tr>
						<td width="10%" class="tableContentTitle tdClassForPrint"><b>Gross Weight  :</b></td>
						<td width="13%" class="tdClassForPrint"><div id="grossWeightForPrint"></div></td>
						<td width="34%" class="tableContentTitle tdClassForPrint"><b>Barcode</b></td>
						<td width="10%" class="tableContentTitle tdClassForPrint"><b>System Date :</b></td>
						<td width="13%" class="tdClassForPrint"><div id="SystemDateForPrint"></div></td>
						
					</tr>
					<tr>
						<td width="10%" class="tableContentTitle tdClassForPrint"><b>Tare Weight  :</b></td>
						<td width="13%" class="tdClassForPrint"><div id="tareWeightForPrint"></div></td>
						<td width="34%" class="tdClassForPrint" rowspan="3"><div id="barcodeGeneratorDivForPrint" class="barcodeGeneratorDiv"></div></td>
						<td width="10%" class="tableContentTitle tdClassForPrint" rowspan="2"><b>System time :</b></td>
						<td width="13%" class="tdClassForPrint" rowspan="2"><div id="SystemTimeForPrint"></div></td>
						 
					</tr>
					<tr>
						<td width="10%" class="tableContentTitle tdClassForPrint"><b>Net Weight  :</b></td>
						<td width="13%" class="tdClassForPrint"><div id="netWeightForPrint"></div></td>
					</tr>
					<tr>
						<td width="10%" class="tableContentTitle tdClassForPrint"><b>Operator Signature :</b></td>
						<td width="13%" class="tdClassForPrint"><div id="OperatorSignForPrint"></div></td>
						<td width="10%" class="tableContentTitle tdClassForPrint"><b>User ID :</b></td>
						<td width="13%" class="tdClassForPrint"><div id="UserIDForPrint"></div></td>
					</tr>
				
				</table>
			</div>
			</fieldset>
			</div>
	
	
	</div>
	
</body>
</html>